//
// Created by madison on 2022/1/31.
// 计算自然数之和
//

#include <iostream>

using namespace std;

int main() {

    int n, sum = 0;

    cout << "输入一个正整数: ";
    cin >> n;

    for (int i = 1; i <= n; ++i) {
        sum += i;
    }

    cout << "Sum = " << sum;

    return 0;
}

